package com.mall.model.dto;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @ClassName MyPage
 * @Description
 * @Author dcq
 * @Date 2023/3/11 21:31
 * @Version 1.0
 */
@Data
public class MyPage<T> implements Serializable {
    private Integer  pageNum;
    private Integer  pageSize;
    private Integer  total;
    private Integer   totalPage;
    private List<T>  list;
    public  MyPage(Integer page1,Integer pageSize,Integer cont,Page page){
        this.pageNum=page1;
        this.pageSize=pageSize;
        this.list=page.getRecords();
        this.total=cont;
        this.totalPage= total % pageSize == 0 ? total / pageSize : total / pageSize + 1;

    }
}